package com.xinzhi.controller;

import com.xinzhi.pojo.OneGradeIndex;
import com.xinzhi.pojo.TwoGradeIndex;
import com.xinzhi.service.LfaService;
import com.xinzhi.service.OneGradeService;
import com.xinzhi.service.ReasonService;

import com.xinzhi.service.TwoGradeIndexService;
import com.xinzhi.service.ReasonService;

import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController

public class ReasonController {


    @Autowired
    private OneGradeService oneGradeService;
    @Autowired
    private LfaService lfaService;
    @Autowired
    private TwoGradeIndexService twoGradeIndexService;

    /**
     * 指标框架制定的查询接口
     * @return
     */
    @GetMapping("/getAll")
    public List<OneGradeIndex> getAll(){
        return oneGradeService.getAll();
    }






    /**
     * 指标框架制定的删除接口
     * @return
     */


    @PostMapping ("/selectlist")
    private Result Lfaselect(int twoIndexid) {
        return null;
    }

    @PostMapping("/lynupdate")
    private Result lynupdate(Integer twoIndexId, Integer type) {
        return lfaService.lynupdate(twoIndexId, type);
    }


    /**
     * 指标框架制定的修改接口
     */

    @PostMapping("/updateTwoGradeIndex")
    Result update(@RequestBody TwoGradeIndex twogradeindex){
        Result update = twoGradeIndexService.update(twogradeindex);
        return update;
    }

}

